package com.kingland.neusoft.course.service;

import com.kingland.neusoft.course.mapper.BookMapper;
import com.kingland.neusoft.course.mapper.dao.BookModel;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookService {
    private final BookMapper bookMapper;

    public BookService(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    public void addBook(BookModel bookModel){
        bookMapper.addBook(bookModel);
    }
    public int deleteBook(Long bookId){
        return bookMapper.deleteBookByBookId(bookId);
    }
    public BookModel selectBook(String bookName){
        return bookMapper.selectBookByBookName(bookName);
    }
    public List<BookModel> selectAllBook(){
        return bookMapper.selectAllBook();
    }
    public int count(){
        return bookMapper.count();
    }



}
